//
//  FZCoverLayerButton.swift
//  MyWeiBo
//
//  Created by fangzhengwei on 2017/4/3.
//  Copyright © 2017年 fangzhengwei. All rights reserved.
//

import UIKit

class FZCoverLayerButton: UIButton {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        titleLabel?.font = UIFont.systemFont(ofSize: 14)
        setTitleColor(UIColor.darkGray, for: .normal)
        titleLabel?.textAlignment = .center
        imageView?.contentMode = .center
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        imageView?.frame = CGRect(x: 0, y: 0, width: self.bounds.size.width, height: self.bounds.size.width)
        
        titleLabel?.frame = CGRect(x: 0, y: self.bounds.size.width, width: self.bounds.size.width, height: self.bounds.size.height - self.bounds.size.width)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
